Magento 2 Useful Commands Shortcut

List of useful commands for Magento 2 shortcuts  

To know the Magento version running

 php bin/magento --version  

Setup Upgrade Using Command Line  

 php bin/magento setup:upgrade  

  

If you don’t want to remove pub/static files while installing/updating the database then use the following command.  

 php bin/magento setup:upgrade --keep-generated  

  

 Cache Clean Using Command Line  

 php bin/magento cache:clean  

  

 Cache Flush Using Command Line  

 php bin/magento cache:flush  

  

 View cache status Using following command Line  

 php bin/magento cache:status  

  

 Enable Cache Using Command Line  

 php bin/magento cache:enable  

  

Disable Cache Using Command Line  

 php bin/magento cache:disable [cache_type]  

  

 Static Content Deploy Using Command Line  

 php bin/magento setup:static-content:deploy  

 (Use -f for force deploy on 2.2.x or later)  

 php bin/magento setup:static-content:deploy -f  

  

 Static Content Deploy For Particular Language Using Command Line  

 php bin/magento setup:static-content:deploy en_US  

  

 Static Content Deploy For Magento Backend Theme Using Command Line (Working on 2.1.1 or later)  

 php bin/magento setup:static-content:deploy --theme="Magento/backend"  

  

 Static Content Deploy For Specific Themes Using Command Line (Working on 2.1.1 or later)  

 php bin/magento setup:static-content:deploy --theme Magento/luma --theme Magento/second_theme  

 Enable module Using Command Line  

 php bin/magento module:enable Namespace_Module  

  

 Disable module Using Command Line  

 php bin/magento module:disable Namespace_Module  

  

Uninstall Module Using Command Line  

 php bin/magento module:uninstall Namespace_Module  

  

 Reindexing Using Command Line  

 php bin/magento indexer:reindex  

  

View the list of indexers Using Command Line  

 php bin/magento indexer:info  

  

View indexer status Using Command Line  

 php bin/magento indexer:status  

  

 Show the mode of all indexers Using Command Line      

 php bin/magento module:status  

  

 Check Current Mode Using Command Line  

 php bin/magento deploy:mode:show  

  

 Change To Developer Mode Using Command Line  

 php bin/magento deploy:mode:set developer  

  

 Change To Production Mode Using Command Line  

 php bin/magento deploy:mode:set production  

  

 Run the single-tenant Compiler Using Command Line  

php bin/magento setup:di:compile  

  

Unlock Admin User Using Command Line  

 php bin/magento admin:user:unlock adminusername  

  

 Enable Maintenance Mode Using Command Line  

 php bin/magento maintenance:enable  

  

 To enable maintenance mode for all clients except 192.0.0.1 and 192.0.0.2  

 php bin/magento maintenance:enable --ip=192.0.0.1 --ip=192.0.0.2  

  

 To clear the list of IPs.  

 php bin/magento maintenance:enable --ip=none  

  

 Disable Maintenance Mode Using Command Line  

 php bin/magento maintenance:disable  

  

 Check Maintenance Mode Status Using Command Line  

 php bin/magento maintenance:status  

  

 How to Allow IP on Maintenance Mode Using Command Line  

 php bin/magento maintenance:allow-ips --ip=192.0.0.1 --ip=192.0.0.2  

  

 Set Magento crontab Using Command Line  

 php bin/magento cron:install --force (Use --force to rewrite an existing Magento crontab.)  

  

 To view the crontab, enter the following command as the Magento file system owner.  

 crontab -l  

  

Remove Magento crontab Using Command Line  

php bin/magento cron:remove  

Enable Merge CSS

php bin/magento config:set dev/css/merge_css_files 1

Disable Merge CSS

php bin/magento config:set dev/css/merge_css_files 0

Enable Merge JS

php bin/magento config:set dev/js/merge_files 1

Disable Merge JS

php bin/magento config:set dev/js/merge_files 0

Enable Frontend template hints

php bin/magento dev:template-hints:enable

Disable Frontend template hints

php bin/magento dev:template-hints:disable

Check to determine whether or not you need to upgrade the database (using setup:upgrade)

php bin/magento setup:db:status

Enable database query log 

php bin/magento dev:query-log:enable

2   0
Shailesh Kumar
profile affan 1st May 2024

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me.플레이포커머니상

Write a comment ...
Post comment
Cancel
profile mehmood 1st May 2024

Cool stuff you have got and you keep update all of us.강남관전클럽

Write a comment ...
Post comment
Cancel
profile khalani 30th April 2024

Rainbet's VIP program offers exclusive bonuses and premium perks! Explore top online casinos, enjoy free spins, and elevate your gaming adventure. Online casino withdrawal times

Write a comment ...
Post comment
Cancel
profile humza 30th April 2024

Get the best of both worlds: better odds and security at TotoBit-recommended sports betting sites.토토사이트

Write a comment ...
Post comment
Cancel
profile khalani 29th April 2024

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me. 호빠

Write a comment ...
Post comment
Cancel
profile mehmood 28th April 2024

Thank you very much for this useful article. I like it.situs judi slot

Write a comment ...
Post comment
Cancel
profile hunain 28th April 2024

I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work... ceramic roof tiles

Write a comment ...
Post comment
Cancel
profile hunain 28th April 2024

This is highly informatics, crisp and clear. I think that everything has been described in systematic manner so that reader could get maximum information and learn many things. ceramic roof tiles

Write a comment ...
Post comment
Cancel
profile hunain 27th April 2024

very interesting post.this is my first time visit here.i found so mmany interesting stuff in your blog especially its discussion..thanks for the post! Skrota bil Kungälv

Write a comment ...
Post comment
Cancel
profile inserts 23rd April 2024

products have Turning Carbide Inserts avantgarde design , which can make you look stylish and modern in any occasion.Numerous returned https://carbideinserts.bcz.com/ customers possess a Kennametal Inserts passion to enjoy probably the most product good carbide inserts because of their super quality but lowest price.

Write a comment ...
Post comment
Cancel
profile khalani 23rd April 2024

This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post. 무료웹툰

Write a comment ...
Post comment
Cancel
profile mehmood 21st April 2024

Excellent Submit, I will be a huge believer inside submitting feedback about web sites to be able to allow the website copy writers understand that they’ve extra one thing useful to be able to the net!메이저사이트

Write a comment ...
Post comment
Cancel
profile mehmood 21st April 2024

I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work.사설토토사이트

Write a comment ...
Post comment
Cancel
profile mehmood 20th April 2024

Thank you so much for the post you do. I like your post and all you share with us is up to date and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job.アリエクプロモコード

Write a comment ...
Post comment
Cancel
profile hunain 20th April 2024

nice post, keep up with this interesting work. It really is good to know that this topic is being covered also on this web site so cheers for taking time to discuss this! apollo tv app

Write a comment ...
Post comment
Cancel

Please rotate your device

We don't support landscape mode on your device. Please rotate to portrait mode for the best view of our site